.class public Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;
.super Landroid/widget/ArrayAdapter;
.source "ViewSearch.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/ViewSearch;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "PlacesAdapter"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Lcom/glympse/android/glympse/ViewSearch$PlaceItem;",
        ">;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# static fields
.field private static synthetic $SWITCH_TABLE$com$glympse$android$glympse$ViewSearch$PlaceItem$ETypes:[I


# instance fields
.field private m_oLayoutInflater:Landroid/view/LayoutInflater;

.field final synthetic this$0:Lcom/glympse/android/glympse/ViewSearch;


# direct methods
.method static synthetic $SWITCH_TABLE$com$glympse$android$glympse$ViewSearch$PlaceItem$ETypes()[I
    .locals 3

    .prologue
    .line 368
    sget-object v0, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->$SWITCH_TABLE$com$glympse$android$glympse$ViewSearch$PlaceItem$ETypes:[I

    if-eqz v0, :cond_0

    :goto_0
    return-object v0

    :cond_0
    invoke-static {}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->values()[Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    move-result-object v0

    array-length v0, v0

    new-array v0, v0, [I

    :try_start_0
    sget-object v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->EditExistingDestination:Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->ordinal()I

    move-result v1

    const/4 v2, 0x3

    aput v2, v0, v1
    :try_end_0
    .catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_3

    :goto_1
    :try_start_1
    sget-object v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->NoLocation:Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->ordinal()I

    move-result v1

    const/4 v2, 0x1

    aput v2, v0, v1
    :try_end_1
    .catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_2

    :goto_2
    :try_start_2
    sget-object v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->Place:Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->ordinal()I

    move-result v1

    const/4 v2, 0x4

    aput v2, v0, v1
    :try_end_2
    .catch Ljava/lang/NoSuchFieldError; {:try_start_2 .. :try_end_2} :catch_1

    :goto_3
    :try_start_3
    sget-object v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->UseCurrentLocation:Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->ordinal()I

    move-result v1

    const/4 v2, 0x2

    aput v2, v0, v1
    :try_end_3
    .catch Ljava/lang/NoSuchFieldError; {:try_start_3 .. :try_end_3} :catch_0

    :goto_4
    sput-object v0, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->$SWITCH_TABLE$com$glympse$android$glympse$ViewSearch$PlaceItem$ETypes:[I

    goto :goto_0

    :catch_0
    move-exception v1

    goto :goto_4

    :catch_1
    move-exception v1

    goto :goto_3

    :catch_2
    move-exception v1

    goto :goto_2

    :catch_3
    move-exception v1

    goto :goto_1
.end method

.method public constructor <init>(Lcom/glympse/android/glympse/ViewSearch;Landroid/content/Context;Ljava/util/ArrayList;)V
    .locals 1
    .parameter
    .parameter "oContext"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/glympse/android/glympse/ViewSearch$PlaceItem;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 377
    .local p3, listPlaceItems:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/glympse/android/glympse/ViewSearch$PlaceItem;>;"
    iput-object p1, p0, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->this$0:Lcom/glympse/android/glympse/ViewSearch;

    .line 375
    const/4 v0, 0x0

    invoke-direct {p0, p2, v0, p3}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 370
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->m_oLayoutInflater:Landroid/view/LayoutInflater;

    .line 376
    invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->m_oLayoutInflater:Landroid/view/LayoutInflater;

    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 7
    .parameter "nPosition"
    .parameter "oConvertView"
    .parameter "oParent"

    .prologue
    .line 382
    iget-object v4, p0, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->m_oLayoutInflater:Landroid/view/LayoutInflater;

    const v5, 0x7f03001b

    const/4 v6, 0x0

    invoke-virtual {v4, v5, p3, v6}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v3

    .line 383
    .local v3, oView:Landroid/view/View;
    invoke-virtual {p0, p1}, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;

    .line 385
    .local v1, oPlaceItem:Lcom/glympse/android/glympse/ViewSearch$PlaceItem;
    const v4, 0x7f0c0003

    invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    .line 386
    .local v0, oImageView:Landroid/widget/ImageView;
    const v4, 0x7f0c0004

    invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 388
    .local v2, oTextView:Landroid/widget/TextView;
    invoke-static {}, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->$SWITCH_TABLE$com$glympse$android$glympse$ViewSearch$PlaceItem$ETypes()[I

    move-result-object v4

    iget-object v5, v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;->m_eType:Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    invoke-virtual {v5}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->ordinal()I

    move-result v5

    aget v4, v4, v5

    packed-switch v4, :pswitch_data_0

    .line 411
    :goto_0
    return-object v3

    .line 391
    :pswitch_0
    const v4, 0x7f020036

    invoke-virtual {v0, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 392
    const v4, 0x7f0a008f

    invoke-virtual {v2, v4}, Landroid/widget/TextView;->setText(I)V

    goto :goto_0

    .line 396
    :pswitch_1
    const v4, 0x7f020033

    invoke-virtual {v0, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 397
    const v4, 0x7f0a0090

    invoke-virtual {v2, v4}, Landroid/widget/TextView;->setText(I)V

    goto :goto_0

    .line 401
    :pswitch_2
    const v4, 0x7f020034

    invoke-virtual {v0, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 402
    const v4, 0x7f0a0091

    invoke-virtual {v2, v4}, Landroid/widget/TextView;->setText(I)V

    goto :goto_0

    .line 406
    :pswitch_3
    const v4, 0x7f020035

    invoke-virtual {v0, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 407
    iget-object v4, v1, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;->m_oPlace:Lcom/glympse/platform/common/Place;

    iget-object v4, v4, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    invoke-virtual {v2, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 388
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 7
    .parameter
    .parameter "oView"
    .parameter "nPosition"
    .parameter "nId"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .local p1, oAdapterView:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    const/4 v4, 0x5

    const-wide/16 v2, 0x0

    .line 417
    invoke-virtual {p1, p3}, Landroid/widget/AdapterView;->getItemAtPosition(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;

    .line 419
    .local v6, oPlaceItem:Lcom/glympse/android/glympse/ViewSearch$PlaceItem;
    invoke-static {}, Lcom/glympse/android/glympse/ViewSearch$PlacesAdapter;->$SWITCH_TABLE$com$glympse$android$glympse$ViewSearch$PlaceItem$ETypes()[I

    move-result-object v0

    iget-object v1, v6, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;->m_eType:Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/ViewSearch$PlaceItem$ETypes;->ordinal()I

    move-result v1

    aget v0, v0, v1

    packed-switch v0, :pswitch_data_0

    .line 457
    :cond_0
    :goto_0
    return-void

    .line 422
    :pswitch_0
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v0, v0, Lcom/glympse/android/glympse/Glympse;->m_oViewSendGlympse:Lcom/glympse/android/glympse/ViewSendGlympse;

    const-string v1, ""

    move-wide v4, v2

    invoke-virtual/range {v0 .. v5}, Lcom/glympse/android/glympse/ViewSendGlympse;->SetDestination(Ljava/lang/String;DD)V

    .line 423
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v0}, Lcom/glympse/android/glympse/Glympse;->PopView()Lcom/glympse/android/glympse/Glympse$EViews;

    goto :goto_0

    .line 427
    :pswitch_1
    sget-object v0, Lcom/glympse/android/glympse/Glympse$EViews;->Destination:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/Glympse;->GetCurrentEView()Lcom/glympse/android/glympse/Glympse$EViews;

    move-result-object v1

    if-eq v0, v1, :cond_0

    .line 429
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v0, v0, Lcom/glympse/android/glympse/Glympse;->m_oViewDestination:Lcom/glympse/android/glympse/ViewDestination;

    .line 430
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget-object v2, v2, Lcom/glympse/platform/LocManager;->m_oLastLocPoint:Lcom/glympse/platform/common/LocPoint;

    iget-wide v2, v2, Lcom/glympse/platform/common/LocPoint;->m_dLatitude:D

    invoke-static {v2, v3, v4}, Lcom/glympse/platform/common/Helpers;->DoubleToStr(DI)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, ", "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    .line 431
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget-object v2, v2, Lcom/glympse/platform/LocManager;->m_oLastLocPoint:Lcom/glympse/platform/common/LocPoint;

    iget-wide v2, v2, Lcom/glympse/platform/common/LocPoint;->m_dLongitude:D

    invoke-static {v2, v3, v4}, Lcom/glympse/platform/common/Helpers;->DoubleToStr(DI)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    .line 430
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 432
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget-object v2, v2, Lcom/glympse/platform/LocManager;->m_oLastLocPoint:Lcom/glympse/platform/common/LocPoint;

    iget-wide v2, v2, Lcom/glympse/platform/common/LocPoint;->m_dLatitude:D

    .line 433
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget-object v4, v4, Lcom/glympse/platform/LocManager;->m_oLastLocPoint:Lcom/glympse/platform/common/LocPoint;

    iget-wide v4, v4, Lcom/glympse/platform/common/LocPoint;->m_dLongitude:D

    .line 429
    invoke-virtual/range {v0 .. v5}, Lcom/glympse/android/glympse/ViewDestination;->SetDestination(Ljava/lang/String;DD)V

    .line 434
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    sget-object v1, Lcom/glympse/android/glympse/Glympse$EViews;->Destination:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v2, Lcom/glympse/android/glympse/Glympse$EAnimations;->SlideLeft:Lcom/glympse/android/glympse/Glympse$EAnimations;

    sget-object v3, Lcom/glympse/android/glympse/Glympse$EAnimations;->SlideRight:Lcom/glympse/android/glympse/Glympse$EAnimations;

    invoke-virtual {v0, v1, v2, v3}, Lcom/glympse/android/glympse/Glympse;->PushView(Lcom/glympse/android/glympse/Glympse$EViews;Lcom/glympse/android/glympse/Glympse$EAnimations;Lcom/glympse/android/glympse/Glympse$EAnimations;)Lcom/glympse/android/glympse/Glympse$EViews;

    goto :goto_0

    .line 439
    :pswitch_2
    sget-object v0, Lcom/glympse/android/glympse/Glympse$EViews;->Destination:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/Glympse;->GetCurrentEView()Lcom/glympse/android/glympse/Glympse$EViews;

    move-result-object v1

    if-eq v0, v1, :cond_0

    .line 441
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v0, v0, Lcom/glympse/android/glympse/Glympse;->m_oViewDestination:Lcom/glympse/android/glympse/ViewDestination;

    .line 442
    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v1, v1, Lcom/glympse/android/glympse/Glympse;->m_oViewSendGlympse:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/ViewSendGlympse;->GetDestination()Lcom/glympse/platform/common/Place;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    .line 443
    sget-object v2, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v2, v2, Lcom/glympse/android/glympse/Glympse;->m_oViewSendGlympse:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->GetDestination()Lcom/glympse/platform/common/Place;

    move-result-object v2

    iget-wide v2, v2, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    .line 444
    sget-object v4, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v4, v4, Lcom/glympse/android/glympse/Glympse;->m_oViewSendGlympse:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v4}, Lcom/glympse/android/glympse/ViewSendGlympse;->GetDestination()Lcom/glympse/platform/common/Place;

    move-result-object v4

    iget-wide v4, v4, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    .line 441
    invoke-virtual/range {v0 .. v5}, Lcom/glympse/android/glympse/ViewDestination;->SetDestination(Ljava/lang/String;DD)V

    .line 445
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    sget-object v1, Lcom/glympse/android/glympse/Glympse$EViews;->Destination:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v2, Lcom/glympse/android/glympse/Glympse$EAnimations;->SlideLeft:Lcom/glympse/android/glympse/Glympse$EAnimations;

    sget-object v3, Lcom/glympse/android/glympse/Glympse$EAnimations;->SlideRight:Lcom/glympse/android/glympse/Glympse$EAnimations;

    invoke-virtual {v0, v1, v2, v3}, Lcom/glympse/android/glympse/Glympse;->PushView(Lcom/glympse/android/glympse/Glympse$EViews;Lcom/glympse/android/glympse/Glympse$EAnimations;Lcom/glympse/android/glympse/Glympse$EAnimations;)Lcom/glympse/android/glympse/Glympse$EViews;

    goto/16 :goto_0

    .line 450
    :pswitch_3
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v0, v0, Lcom/glympse/android/glympse/Glympse;->m_oViewSendGlympse:Lcom/glympse/android/glympse/ViewSendGlympse;

    .line 451
    iget-object v1, v6, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;->m_oPlace:Lcom/glympse/platform/common/Place;

    iget-object v1, v1, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    .line 452
    iget-object v2, v6, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;->m_oPlace:Lcom/glympse/platform/common/Place;

    iget-wide v2, v2, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    .line 453
    iget-object v4, v6, Lcom/glympse/android/glympse/ViewSearch$PlaceItem;->m_oPlace:Lcom/glympse/platform/common/Place;

    iget-wide v4, v4, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    .line 450
    invoke-virtual/range {v0 .. v5}, Lcom/glympse/android/glympse/ViewSendGlympse;->SetDestination(Ljava/lang/String;DD)V

    .line 454
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v0}, Lcom/glympse/android/glympse/Glympse;->PopView()Lcom/glympse/android/glympse/Glympse$EViews;

    goto/16 :goto_0

    .line 419
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method
